package cn.sytton.taffe.web.sys.entity;

import cn.sytton.taffe.framework.base.entity.BaseUpdatedEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import cn.sytton.taffe.framework.validation.Field;
import cn.sytton.taffe.framework.validation.NotDuplicate;

import javax.validation.constraints.*;

/**
 * 职位岗位entity sys_position
 *
 * @author skyrock
 */
@Schema(description = "职位")
@Data
@EqualsAndHashCode(callSuper = true)
@NotDuplicate(value = {
        @Field(name = {"positionCode"}, message = "职位编号[ %s ]已存在"),
        @Field(name = {"positionName"}, message = "职位名称[ %s ]已存在")},
        excludeByField="positionId")
@TableName("sys_position")
public class PositionEntity extends BaseUpdatedEntity {

    @Schema(description = "职位ID")
    @TableId(type = IdType.ASSIGN_ID)
    private String positionId;    // 职位ID

    @Schema(description = "职位编号")
    @NotNull(message = "职位编号不能为空")
    private String positionCode;    // 职位编号 

    @Schema(description = "职位名称")
    @NotNull(message = "职位名称不能为空")
    private String positionName;    // 职位名称 

    @Schema(description = "顺序")
    private Integer seq =  0;    // 顺序 

    @Schema(description = "状态: 启用1/禁用0")
    private Integer status =  1;    // 状态（1启用 0禁用） 

    //-----以下是关联属性-----
}
